#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/12/6 9:23
# @Author  : lizhen
# @Site    : 
# @File    : E004_tcp__client.py
# @Software: PyCharm
from socket import socket


def tcp_client():
    sock = socket()
    sock.connect(('localhost', 8000))
    sock.send('你好啊'.encode())
    while True:
        data = sock.recv(1024)
        print(data.decode())


def main():
    tcp_client()


if __name__ == '__main__':
    main()
